FROM node:22.11

RUN mkdir -p /app/automation_serve/

COPY . /app/automation_serve

WORKDIR /app/automation_serve

#安装依赖:通过npm安装依赖时,有时会报错,这时可以通过安装cnpm来安装依赖
RUN  npm install -g cnpm --registry=http://registry.npmmirror.com
RUN cnpm install

EXPOSE 3001

# 容器启动时执行的命令，类似npm run start
CMD ["npm","run", "serve"]

#docker build -t automation_server .
#docker run -p 3001:3001 -d --name automation_server automation_server 
#update user set host = '%' where user = 'root';
#flush privileges;
#docker update --restart=always mycontainer
